<?php
$key=ftok(__FILE__,'a');


$msgtype=1;
$handle=msg_get_queue($key);

$signalSupport = [
    'stop'    => SIGHUP, //平滑停止
    'STOP'    => SIGTERM, //强行停止
    'restart' => SIGUSR1 //重启worker
];
foreach ($signalSupport as $v){
    pcntl_signal($v, 'dispatchSign', false);
}
function dispatchSign($sign)
{
    echo $sign.PHP_EOL;
}



